{% extends 'base.html' %}
{% block content %}

<div class="container">
    <div style="margin-bottom: 10px" class="clearfix">
        <a class="btn btn-success" href="/user/add">
            <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
            添加用户
        </a>
        <div style="float: right;width: 500px">
            <form method="get">
                <div class="col-lg-6">
                    <div class="input-group">
                        <input type="text" name="u" class="form-control" placeholder="Search for..." value={{ search_data }}>
                        <span class="input-group-btn">
                        <button class="btn btn-default" type="submit">
                            <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                        </button>
                      </span>
                    </div><!-- /input-group -->
                  </div><!-- /.col-lg-6 -->
            </form>
        </div>

    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
            用户列表
        </div>

    <table class="table table-bordered">
        <tr>
            <th>用户</th>
            <th>描述</th>
            <th>操作</th>
        </tr>
        {% for user in queryset %}
            <tr>
                <td>{{ user.username}}</td>
                <td>{{ user.password }}</td>
                <td>
                    <a class="btn btn-primary btn-xs" href="/user/?nid={{ user.id }}">删除</a>
                    <a class="btn btn-primary btn-xs" href="/user/{{ user.id }}/edit/">编辑</a>
                </td>
            </tr>
        {% endfor %}
    </table>
    </div>
    <ul class="pagination">
        {{ page_string }}
    </ul>
</div>
{% endblock%}